package com.way.v1;

/**
 * @author 魏彪
 */
public class Test02 {
    public static void main(String[] args) {
        // PromotionActivity activity = new PromotionActivity(new CouponStrategy());
        // PromotionActivity activity2 = new PromotionActivity(new CashbackStrategy());
        // activity.promotion();
        // activity2.promotion();

        String key = "COUPON";

        PromotionActivity activity;

        if (key.equals("COUPON")) {
            activity = new PromotionActivity(new CouponStrategy());
        } else if (key.equals("CASHBACK")) {
            activity = new PromotionActivity(new CashbackStrategy());
        } else {
            activity = new PromotionActivity(new EmptyStrategy());
        }
        activity.promotion();
    }
}
